#ifndef BITENCODER_H
#define BITENCODER_H

#include <QObject>

namespace WingGif {

class BitEncoder : public QObject {
  Q_OBJECT
public:
  explicit BitEncoder(int initBit = 8, QObject *parent = nullptr);

  int length();
  // Current length of the output.

  void add(int inByte);

  void end();

public:
  QByteArray outList;
  // Output byte of data collection.

  int inBit;

private:
  int _currentBit = 0;
  // The last remaining bit

  int _currentVal;
};

} // namespace WingGif

#endif // BITENCODER_H
